package com.lhy.admin.common.mvcplus.wrapper.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lhy.admin.common.mvcplus.entity.ComparatorEnum;
import com.lhy.admin.common.mvcplus.entity.DbField;
import com.lhy.admin.common.mvcplus.wrapper.AbstractSearchComparator;

public class NotBetweenSearchComparator extends AbstractSearchComparator {

    @Override
    public void accept(QueryWrapper queryWrapper, DbField dbField) {
        String[] split = splitStr(dbField.getValue());
        if (split.length == 2) {
            queryWrapper.notBetween(dbField.getName(), split[0], split[1]);
        }
    }

    @Override
    public ComparatorEnum comparatorEnum() {
        return ComparatorEnum.NOT_BETWEEN;
    }
}
